﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>实名认证管理</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
	<span class="c-gray en">&gt;</span>
	审核项目
	<span class="c-gray en">&gt;</span>
	材料认证管理
	<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container">
	<div class="text-c">
		<div class="text-c">
			<span class="select-box inline">
				<select id="state"  class="select">
					<option value="">全部状态</option>
					<option value="0">待审核</option>
					<option value="1">审核通过</option>
					<option value="2">审核拒绝</option>
				</select>
			</span>
			日期范围：
			<input type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'endDate\')||\'%y-%M-%d\'}' })" id="beginDate" class="input-text Wdate" style="width:120px;">
			-
			<input type="text" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'%y-%M-%d' })" id="endDate" class="input-text Wdate" style="width:120px;">
			<input type="text" class="input-text" style="width:350px" placeholder="id、用户名、审核人、分数、材料类型" id="criteria" >
			<button type="submit" class="btn btn-success radius" id="search" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
		</div>

	<div class="cl pd-5 bg-1 bk-gray mt-20">
		<span class="r">共有数据：<strong id="count">0</strong> 条</span>
	</div>
	<div class="mt-20">
		<div id="dataTables" class="dataTables_wrapper no-footer">
		<div class="dataTables_length" ><label>显示 <select id="pageSize" aria-controls="DataTables_Table_0" class="select"><option value="10">10</option><option value="25">25</option><option value="50">50</option><option value="100">100</option></select> 条</label></div>
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			<thead>
				<tr class="text-c">
					<th width="100">ID</th>
					<th width="200">用户名</th>
					<th width="200">状态</th>
					<th width="150">分数</th>
					<th width="600">材料类型</th>
					<th width="200">审核人</th>
					<th width="">操作</th>
				</tr>
			</thead>
			<tbody class="text-c">
			</tbody>
		</table>
			<div class="dataTables_info" id="DataTables_Table_0_info" role="status" aria-live="polite">显示 <span id="startRow">0</span> 到 <span id="endRow">0</span> ，共 <span id="total">0</span> 条</div>
		</div>
	</div>
</div>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
	var pageNum =1 ;
    var id=null;
    var table= $('.table-sort').dataTable({
            "aaSorting": [[ 1, "desc" ]],//默认第几个排序
            "bStateSave": true,//状态保存
        	"lengthChange": false,//是否允许改变分页大小
        	"paging": false,//是否开启本地分页
        	"info": false,//是否显示左下角信息
            "aoColumnDefs": [
                //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
                {"orderable":false,"aTargets":[6]}// 制定列不参与排序
            ],
            "ajax" : {
                url:"allUserFileAuth.do",
                async:false,
                cache:false,
                type:"post",
                dataType:"json",
                dataSrc:function(data){//这是从服务器接受的数据（名称、格式）
                    //没有数据的处理
                    if(data.data==null){
                        return 0;
                    }
					$("#count").text(data.data.total);
					$("#startRow").text(data.data.startRow);
                    $("#endRow").text(data.data.endRow);
                    $("#total").text(data.data.total);
                    //计算分页
                    $("#pageData").remove();//删除自己
                    if(data.data.pageNum<1){
                        data.data.pageNum=1;
					}
                    var html='<div class="dataTables_paginate paging_simple_numbers" id="pageData">';
						html+='<a class="paginate_button" data-dt-idx="'+(data.data.pageNum-1)+'">上一页</a>';
						var length=data.data.navigatepageNums.length;
						for(var i=1;i<=length;i++){
						    if(data.data.pageNum==i){
                                html+='<span><a class="paginate_button current"  data-dt-idx='+i+'>'+i+'</a></span>';
                            }else{
                                html+='<span><a class="paginate_button"  data-dt-idx='+i+'>'+i+'</a></span>';
                            }
                        }
						html+='<a class="paginate_button"  data-dt-idx="'+data.data.nextPage+'">下一页</a>';
						html+='</div>';
					$("#dataTables").append(html);
                    //改变分页
                    $('.paginate_button').on('click', function() {
                        pageNum=$(this).attr("data-dt-idx");
                        DataTablesReloda();
                    });
					return data.data.list;
                }
            },
            "columns" : [
                {"data":"id"},
                {"data":"applier.username"},
                {"data":"stateDisplay"},
                {"data":"score"},
                {"data":"fileTypes.title"},
                {"data":null,
					"render":function(data)
					{
					    if(data.auditor != null)
					    {
					        return data.auditor.username;
						}
						return "";
					}
				},
                {"data":null,
                    "render":function(data,type,row){

                        if(data.state===0){
                            var html="<a style='text-decoration:none' onclick=\"system_data_edit('材料认认证审核','userFileAuthAudit.html','"+data.id+"','810','580')\" href='javascript:;' title='审核'><i class='Hui-iconfont'>&#xe692;</i></a>";
                            return html;
                        }
                        var html="<a style='text-decoration:none' onclick=\"system_data_edit('材料认认证审核','userFileAuthAudit.html','"+data.id+"','810','580')\" href='javascript:;' title='查看'><i class='Hui-iconfont'>&#xe665;</i></a>";
                        return html;
                    }
                }
            ]
        });
    //重新加载表格
function DataTablesReloda(){
    table.api().settings()[0].ajax.data={
        								"beginDate":$("#beginDate").val(),
        								"endDate":$("#endDate").val(),
        								"criteria":$("#criteria").val(),
        								"state":$("#state").val(),
										"pageSize":$("#pageSize").val(),
										"pageNum" :pageNum
    									};
    table.api().ajax.reload();
}
//搜索
	$("#search").click(function(){
        DataTablesReloda();
	})
//状态被改变
	$("#state").change(function(){
        DataTablesReloda();
	})
//页码被改变
$("#pageSize").change(function(){
    DataTablesReloda();
})
	//编辑
function system_data_edit(title,url,ids,w,h){
       id=ids;
      layer_show(title,url,w,h,id);
    }
</script>
</body>
</html>